
<div class="wrapcomment">



<ul class="nav nav-tabs" id="ctab">

  <li class="active"><a href="#vcomment"><i class="icon-eye-open"></i> Comment  ( <?php  echo $data['num']?> ) </a></li>
</ul>

<div class="tab-content">
  <div class="tab-pane active" id="vcomment">
  <form class="form-horizontal">
      
      
                   			<?php if(!isset($_SESSION['username']))
											{
												?>
                                             		      
         	 
                 <input type="text" id="comment_user" placeholder="Your name..."><br /><br />
                  
      
        								 <input type="hidden" id="comment_pid" value="" />
                                          <input type="hidden" id="comment_geturl" value="<?php echo $data[geturl]?>" />
                                         <input type="hidden" id="comment_tieude" value="<?php echo2($data[tieude])?>" />
                                          <input type="hidden" id="comment_url" value="<?php echo url();?>" />
         									<input type="hidden" id="comment_id" value="<?php if(!$data['cid']){ ?><?php echo $_GET['id'];?><?php }else{echo $data['cid'];}?>" />
                                            <input type="hidden" id="ip" value="<?php echo get_ip();?>" /></li>
                     
                          <?php
											}else{?>
                                            <input type="hidden" id="comment_user" placeholder="Your name..." value="<?php echo $_SESSION['username']?>" >                   
        								 <input type="hidden" id="comment_pid" value="" />
                                          <input type="hidden" id="comment_geturl" value="<?php echo $data[geturl]?>" />
                                         <input type="hidden" id="comment_tieude" value="<?php echo2($data[tieude])?>" />
                                          <input type="hidden" id="comment_url" value="<?php echo url();?>" />
         									<input type="hidden" id="comment_id" value="<?php if(!$data['cid']){ ?><?php echo $_GET['id'];?><?php }else{echo $data['cid'];}?>" />
                                            <input type="hidden" id="ip" value="<?php echo get_ip();?>" /></li>
                                            
                                            <?php
											}?>
                                                                   
                                         
 
  
                               
                                          <textarea name="comment_content" id="comment_content"  placeholder="Comment..."></textarea><br /><br />
                              
                                       
                                          <a class="btn" id="bntcomment" onclick="add_comment()" >COMMENT</a>
                          
                                    </form>
     <?php
	 	
								 		if($data[data])
                                        foreach($data[data] as $row)
										{
											
											?>
<div class="media " style="border-bottom:1px  dotted #CCC">

          <div class="media-body">
                             <div ><span style="font-size:10px">	<em><i class="icon-user"></i> <?php  if($row['lv']==1){?><span class="label label-important"> <?php echo $row['user']; ?></span><?php }else{?> <?php echo $row['user']; ?><?php }?>  /  <i class="icon-time"></i> <?php echo $row['time_add'];?></em></span> </div>
                        		<?php echo $row['content'];?>
                			 <br />
                        <div  style="text-align:right;; padding-bottom:5px">
                              <a class="btn  btn-small  btn-warning "  href="javascript:quote('<?php echo $row['user'];?>',<?php echo $row['id']?>)" ><i class="icon-comment icon-white"></i> Reply</a>
                              <?php
							  	if($data[per]==1 || $data[per]==2)
										{
										?>
                              <a class="btn btn-small  btn-warning"    href="javascript:delete_comment(<?php echo $row['id']?>,<?php echo $_GET['id'];?>,'news')"><i class="icon-remove  icon-white"></i> Delete</a>
                              <?php
										}?>
						</div>
                  
                            
                                          <?php
							   if($row['reply']==1){
								   ?>   		<div  style="border-bottom: 1px dashed #999">&nbsp;</div>
                                       <?php
								foreach($row['replydata'] as $rc){
								?>
                                    <!-- SubComment -->
                                    <div class="media">
                                    <blockquote>
                                                    <div><span style="font-size:10px">	<em></em></span></div>
                                                     <?php echo $rc['content']; ?>
                                                     <small><i class="icon-user"></i><?php  if($rc['lv']==1){?><span class="label label-important"> <?php echo $rc['user']; ?></span><?php }else{?> <?php echo $rc['user']; ?><?php }?> /  <i class="icon-time"></i><?php echo $rc['time_add']; ?></small>
                                                     
                                                      <br />       <?php
														if($data[per]==1 || $data[per]==2)
														{
														?>
                                                                             <div  style="text-align:right">
                                                							   <a class="btn btn-small  btn-warning" href="javascript:delete_comment(<?php echo $rc['id']?>,<?php echo $_GET['id'];?>,'news')"><i class="icon-remove  icon-white"></i> Delete</a>
                                                                            </div>
                                                        <?php
														}
                                                     ?>
                                            </blockquote>         
                                    </div><!-- End of SubComment -->
                                      <?php }?>
                                    
                                    <?php
							   }?> <!-- ROW REPLY =1 -->
                                
          </div><!-- End of  Media-body main comment -->
</div><!-- End of  Main Media -->




<?php }?>

<div style="height:15px"></div>
<?php
if($data['limit']<$data['num']){?>
<div id="morecm" name="morcecm">
<input type="hidden" id="comment_per"  name="comment_per" value="<?php echo $data['per']?>"/>
<input type="hidden" id="comment_limit"  name="comment_limit" value="<?php  echo $data['limit']?>"/>
<input type="hidden"  id="comment_num" name="comment_num" value="<?php echo  $data['num']?>"/>
<input type="hidden"  id="comment_next" name="comment_next" value="10"/>

<a  onclick="loadmore_comment()" class="btn btn-small btn-block btn-warning" id="morebt" name="morebt"><strong>View More</strong></a>

</div>
<?php
}
?>

  </div><!-- END OF VCOMMENT TAB-->

</div>
 



                 			
                               
                               
</div> <!-- END OF WRAP COMMENT -->
                    

          
             </div> <!-- END OF SPAN8 IN VIEW.PHP -->
					